<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>引用类型的垃圾回收原理</title>
</head>
<body>
    <script>
        let hd = {name : "xiasnn"};
        let xx = hd;
        let arr = [hd];
        // hd,xx,arr共同访问同一块内存地址
        hd = null;
        xx = null;
        arr[0] = null;
        // hd,xx,arr都不访问这块内存地址是，这块内存地址就是垃圾，会被销毁
    </script>
</body>
</html>